package cn.com.cfae.iras.doc.analyze.parse.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 利润表模型
 */
public class LRModel extends BizBaseModel {

    public static String MODEL_NAME = "LR";
    /**
     * 营业收入
     */
    private static String YYSR = "YYSR";

    /**
     * 营业成本
     */
    private static String YYCB = "YYCB";

    /**
     * 税金及附加
     */
    private static String SJJFJ = "SJJFJ";

    /**
     * 销售费用
     */
    private static String XSFY = "XSFY";
    /**
     * 管理费用
     */
    private static String GLFY = "GLFY";

    /**
     * 研发费用
     */
    private static String YFFY = "YFFY";
    /**
     * 财务费用
     */
    private static String CWFY = "CWFY";

    /**
     * 利息费用
     */
    private static String LXFY = "LXFY";

    /**
     * 利息收入
     */
    private static String LXSR = "LXSR";

    /**
     * 资产减值损失
     */
    private static String ZCJZSS = "ZCJZSS";
    /**
     * 加：其他收益
     */
    private static String QTSY = "QTSY";
    /**
     * 投资收益
     */
    private static String TZSY = "TZSY";
    /**
     * 公允价值变动收益
     */
    private static String GYJZBDSY = "GYJZBDSY";
    /**
     * 资产处置收益
     */
    private static String ZCCZSY = "ZCCZSY";

    /**
     * 营业利润
     */
    private static String YYLR = "YYLR";

    /**
     * 加：营业外收入
     */
    private static String YYWSR = "YYWSR";

    /**
     * 减：营业外支出
     */
    private static String YYWZC = "YYWZC";
    /**
     * 利润总额
     */
    private static String LRZE = "LRZE";

    /**
     * 减：所得税费用
     */
    private static String SDSFY = "SDSFY";


    /**
     * 净利润
     */
    private static String JLR = "JLR";

    /**
     * 持续经营净利润
     */
    private static String CXXJYLR = "CXXJYLR";

    /**
     * 终止经营净利润
     */
    private static String ZZJYJLR = "ZZJYJLR";

    /**
     * 其他综合收益的税后净额
     */
    private static String QTZHSYSHJE = "QTZHSYSHJE";

    /**
     * 综合收益总额
     */
    private static String ZHSYZE = "ZHSYZE";

    /**
     * 每股收益
     */
    private static String MGSY = "MGSY";


    /**
     * 基本每股收益
     */
    private static String JBMGSY = "JBMGSY";

    /**
     * 稀释每股收益
     */
    private static String XSMGSY = "XSMGSY";

    private static Map<String, String> items = new HashMap<>();

    static {
        items.put(YYSR, "营业收入|营业总收入");
        items.put(YYCB, "营业成本|营业总成本");
        items.put(SJJFJ, "税金及附加|营业税金及附加");
        items.put(XSFY, "销售费用");
        items.put(GLFY, "管理费用");
        items.put(YFFY, "研发费用");
        items.put(CWFY, "财务费用");
        items.put(LXFY, "利息费用");
        items.put(LXSR, "利息收入");
        items.put(ZCJZSS, "资产减值损失");
        items.put(QTSY, "其他收益");
        items.put(TZSY, "投资收益|投资净收益");
        items.put(GYJZBDSY, "公允价值变动收益");
        items.put(ZCCZSY, "资产处置收益");
        items.put(YYLR, "营业利润");
        items.put(YYWZC, "营业外支出");
        items.put(YYWSR, "营业外收入");
        items.put(LRZE, "利润总额");
        items.put(SDSFY, "所得税费用");
        items.put(JLR, "净利润");
        items.put(CXXJYLR, "持续经营净利润");
        items.put(ZZJYJLR, "终止经营净利润");
        items.put(QTZHSYSHJE, "其他综合收益的税后净额");
        items.put(ZHSYZE, "综合收益总额");
        items.put(MGSY, "每股收益");
        items.put(JBMGSY, "基本每股收益");
        items.put(XSMGSY, "稀释每股收益");

    }

    public static List<ExtractItem> createExtractItemList() {
        List<ExtractItem> extractItemList = new ArrayList<>();
        items.forEach((key, value) -> {
            ExtractItem extractItem = new ExtractItem();
            extractItem.setItemName(key);
            extractItem.setSynonyms(value.split(SYNONYM_SPLIT_CHAR));
            extractItemList.add(extractItem);
        });
        return extractItemList;
    }

}
